package com.estar.integaration.Impl.paymentPlanimpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.estar.integaration.Mapper.paymentPlanMapper.PurchaseOrderDetailMapper;
import com.estar.integaration.Service.paymentPlanService.IPurchaseOrderDetailService;
import com.estar.integaration.entity.paymentPlanEntity.PurchaseOrderDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author YJL
 * @since 2022-02-15
 */
@Service
public class PurchaseOrderDetailServiceImpl extends ServiceImpl<PurchaseOrderDetailMapper, PurchaseOrderDetail> implements IPurchaseOrderDetailService {

  @Autowired
  PurchaseOrderDetailMapper purchaseOrderDetailMapper;

  @Override
  public List<PurchaseOrderDetail> getAllPurchaseOrderDetail() {
    return purchaseOrderDetailMapper.selectList(null);
  }


  //获得所有订单编号(合同号,去重)
  @Override
  public List<String> getAllOrderNumber() {
    Set<String> allOrderNumberHashSet = null;
    QueryWrapper queryWrapper = new QueryWrapper();
    queryWrapper.select("order_number");
    //去重
    List<String> tmpList = purchaseOrderDetailMapper.selectList(queryWrapper);
    allOrderNumberHashSet = new HashSet<>(tmpList);
    tmpList = new ArrayList<>(allOrderNumberHashSet);
    return tmpList;
  }

  @Override
  public Double[] getPriceTaxGatherSum_payAmount() {

    return new Double[0];
  }


}
